<?php
/**
 *  WB_S3ObjStore class
 *  Class which implements the storage of an
 *  objects representation through Amazon S3. 
 *  Used in conjunction with objects of the StorableClass class.
 *
 *  @author Jean-Lou Dupont
 *  @version @@package-version@@
 */

//{{include
 require_once 'web-bloks/PersistentStoreClass/PersistentStoreClass.php';
 require_once 'web-bloks/AmazonS3/AmazonS3.php';
//include}}
 
 class WB_S3ObjStore
 	extends WB_PersistentStoreClass
{
	var $s3 = null;
	
	/**
	* Constructor
	*/
	public function __construct( $params = null )
	{
		// initializes the base class
		parent::__construct( $params );
	}
	// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	// INTERFACE
	// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%	
	/**
	 * Initializes the AMZ layer.
	 * Sets the AMZ keys.
	 * 
	 * @return $this
	 * @param $access string
	 * @param $secret string
	 * @throws
	 */
	public function init( $access, $secret )
	{
		$this->s3 = WB_ObjFactory( 'WB_S3' );
		$this->s3->setKeys( $access, $secret );
		return $this;
	}
} //end class definition
